/*
 * Copyright (c) 2024 Black Sesame Technologies
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef _DAL_GUID_H_
#define _DAL_GUID_H_

#include <stdint.h>
#include "dal/base_type.h"

#ifdef __cplusplus
extern "C" {
#endif

#define GUIDPREFIX_SIZE 12
#define ENTITYID_SIZE 4
#define GUID_SIZE (GUIDPREFIX_SIZE + ENTITYID_SIZE)

typedef struct dal_guid_prefix_s
{
    uint8_t value[GUIDPREFIX_SIZE];
} dal_guid_prefix_t;

typedef struct dal_entityid_s
{
    uint8_t value[ENTITYID_SIZE];
} dal_entityid_t;

typedef struct dal_guid_s
{
    dal_guid_prefix_t guidprefix;
    dal_entityid_t entity_id;
} dal_guid_t;

BOOLEAN dal_guid_is_on_same_host(dal_guid_t* guid_1, dal_guid_t* guid_2);
BOOLEAN dal_guid_is_on_same_process(dal_guid_t* guid_1, dal_guid_t* guid_2);
BOOLEAN dal_guidprefix_is_same(dal_guid_t* guid_1, dal_guid_t* guid_2);

#ifdef __cplusplus
}
#endif

#endif  // _DAL_GUID_H_